﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ChatClientWPFVersion.Utility;
using System.Timers;

namespace ChatClientWPFVersion
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private readonly MessageStream _messageStream;
        private readonly Timer _timer;
        private String _userName;
        private int _userID;
        private String _chatMessage;

        public MainWindow()
        {
            InitializeComponent();
        }

        private void BtnLogIn(object sender, RoutedEventArgs e)
        {
            LogIn();
        }

        void LogIn()
        {
            _userName = textBox3.Text;
            _messageStream.SendMessage("LOGIN" + _userName);
            button1.IsEnabled = true;
            button3.IsEnabled = true;
            textBox2.IsEnabled = true;
        }

        private void BtnGetLoggedInUsers(object sender, RoutedEventArgs e)
        {
            listBox1.Items.Clear();
            _messageStream.SendMessage("GETUSERNAMES");
            listBox1.IsEnabled = true;
            //button4.Enabled = true;
        }

        private void Button2Click(object sender, RoutedEventArgs e)
        {

        }

        private void ListBox1SelectionChanged(object sender, SelectionChangedEventArgs e)
        {

        }

        private void TextBox3TextChanged(object sender, TextChangedEventArgs e)
        {

        }
    }
}
